#include <stdio.h>
#include <stdlib.h>

#define SIZE 10
#define ERROR 0
#define TRUE 1
#define OK 1
#define OVERFLOW 999
typedef int ElemType;
//TREE
typedef struct node {
    char data;
    struct node *left, *right;

} Treenode, *treePtr;

//create
int Create_tree(treePtr *L) {
    char ch;
    scanf("%c", &ch);
    if (ch == '#') {
        (*L) = NULL;
    } else {
        (*L) = (treePtr) malloc(sizeof(Treenode));
        if (!(*L)) {
            return ERROR;//define ERROR 0
        }
        (*L)->data = ch;
        Create_tree(&((*L)->left));
        Create_tree(&((*L)->right));
    }
    return OK;//#define OK 1
}
// FCA##DB###EH##GM###
int Traverse(treePtr L) {
    if (L == NULL) {
        return 0;
    } else {
        Traverse(L->left);
        printf("%c", L->data);
        Traverse(L->right);
    }
}

int main() {
    treePtr L;
    Create_tree(&L);
    Traverse(L);
    return 0;
}